package com.zhx.threadcoreknowledge.synchromized;

/**
 * @author ：zhanghaixuan
 * @date ：Created in 2019-10-02 11:36
 * 用途         ： 可重入粒度测试: 递归调用本方法
 */
public class SynchronizedRecursion10 {
    int a = 0;

    public static void main(String[] args) {
        SynchronizedRecursion10 recursion10 = new SynchronizedRecursion10();
        recursion10.method1();
    }

    private void method1() {
        System.out.println("这是method1,a="+a);
        if(a == 0){
            a++;
            method1();
        }
    }
}
